package leetcode.jianzhioffer;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2021-11-13 12:19
 **/
public class JianZhiOffer20 {

    public boolean isNumber(String s) {
        if (s == null || s.length() == 0) {
            return true;
        }
        s = s.trim();
        try {
            Double a = Double.parseDouble(s);
        } catch (Exception e) {
            return false;
        }
        char c = s.charAt(s.length() - 1);
        return (c >= '0' && c <= '9') || c == '.';
    }

}
